package com.future.hedongjun.home.bean.response;

import com.future.baselib.entity.BaseResponse;
import com.future.hedongjun.home.bean.TopicBean;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

public class ZhuantiListResponse extends BaseResponse {

    public List<TopicBean> data;
    public String title;

    @Override
    public void parseInfo(String content) throws JSONException {
        JSONObject object = new JSONArray(content).optJSONObject(0);
        title = object.optString("title");
        data = new Gson().fromJson(object.optString("list"),new TypeToken<List<TopicBean>>(){}.getType());
    }
}
